import { Tag } from "antd-mobile";
import PropTypes from "prop-types";
import React, { memo } from "react";
import UserInfoCardWrapper from "./style";

const UserInfoBox = memo((props) => {
  let user = props.user;
  return (
    <UserInfoCardWrapper marginTopAndBottom={props.marginTopAndBottom || 20}>
      <div style={{ fontSize: 18 }}>
        <div className="basicInfoItem">
          {user.title && (
            <div>
              <Tag color="#2db7f5" className="infoTitle">
                职位
              </Tag>
              <div> {user.title}</div>
            </div>
          )}
        </div>
        <div className="basicInfoItem">
          {user.desc && (
            <div>
              {user.type === "boss" ? (
                <Tag color="#2db7f5" className="infoTitle">
                  岗位要求
                </Tag>
              ) : (
                <Tag color="#2db7f5" className="infoTitle">
                  个人介绍
                </Tag>
              )}
              {user.desc.split("\n").map((v) => v && <p key={v}>{v}</p>)}
            </div>
          )}
        </div>
        <div className="basicInfoItem">
          {user.money && (
            <div>
              <Tag color="#2db7f5" className="infoTitle">
                薪资
              </Tag>
              <p>{user.money}</p>
            </div>
          )}
        </div>
      </div>
    </UserInfoCardWrapper>
  );
});

UserInfoBox.propTypes = {};

export default UserInfoBox;
